
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class PARTS_SALEMap : EntityTypeConfiguration<PARTS_SALE>
    {
        public PARTS_SALEMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.OBU_NO)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.USER_NO)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.SUPPLIER_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.SPEC_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.AGENT_NO)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.Modify_by)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.REMARK)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("PARTS_SALE");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.OBU_NO).HasColumnName("OBU_NO");
            this.Property(t => t.OBU_REGISTE_DATE).HasColumnName("OBU_REGISTE_DATE");
            this.Property(t => t.USER_NO).HasColumnName("USER_NO");
            this.Property(t => t.PARTS_ID).HasColumnName("PARTS_ID");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.SUPPLIER_NAME).HasColumnName("SUPPLIER_NAME");
            this.Property(t => t.PARTS_SPEC_ID).HasColumnName("PARTS_SPEC_ID");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.AGENT_NO).HasColumnName("AGENT_NO");
            this.Property(t => t.AMOUNT).HasColumnName("AMOUNT");
            this.Property(t => t.REPORT_DATE).HasColumnName("REPORT_DATE");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.Modify_by).HasColumnName("Modify_by");
            this.Property(t => t.Modify_date).HasColumnName("Modify_date");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
        }
    }
}
